const TokenKey = 'vue_admin_template_foreign_'

export function getToken() {
  return localStorage.getItem(TokenKey + 'token')
}

export function getName() {
  return localStorage.getItem(TokenKey + 'name')
}

export function getAvatar() {
  return localStorage.getItem(TokenKey + 'avatar')
}

export function getUserSig() {
  return localStorage.getItem(TokenKey + 'userSig')
}

export function getUserID() {
  return localStorage.getItem(TokenKey + 'UserID')
}

export function getRouter() {
  return JSON.parse(localStorage.getItem(TokenKey + 'menu'))
}

export function getFunctionId() {
  return localStorage.getItem(TokenKey + 'FunctionID')
}

export function setToken(token) {
  return localStorage.setItem(TokenKey + 'token', token)
}

export function setName(name) {
  return localStorage.setItem(TokenKey + 'name', name)
}

export function setAvatar(avatar) {
  return localStorage.setItem(TokenKey + 'avatar', avatar)
}

export function setUserSig(sig) {
  return localStorage.setItem(TokenKey + 'userSig', sig)
}

export function setUserID(id) {
  return localStorage.setItem(TokenKey + 'UserID', id)
}

export function setRouter(router) {
  return localStorage.setItem(TokenKey + 'menu', JSON.stringify(router))
}

export function serFunctionID(id) {
  return localStorage.setItem(TokenKey + 'FunctionID', id)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey + 'token')
}

export function removeName() {
  return localStorage.removeItem(TokenKey + 'name')
}

export function removeAvatar() {
  return localStorage.removeItem(TokenKey + 'avatar')
}

export function removeUserSig() {
  return localStorage.removeItem(TokenKey + 'userSig')
}

export function removeUserID() {
  return localStorage.removeItem(TokenKey + 'UserID')
}

export function removeFunctionId() {
  return localStorage.removeItem(TokenKey + 'FunctionID')
}

export function removeRouter() {
  return localStorage.removeItem(TokenKey + 'menu')
}

